import { defineStore } from "pinia";
import { inject, ref } from "vue";
const mapStore = defineStore('map-store', () => {
    const isZoom = ref(false)
    const isClickTool = ref(false)
    const isDraw = ref(false)
    const isAdd = ref(false)
    const isAdded = ref(false)
    const isTrue = ref(true)
    const isSelected = ref(false)
    const isNotice = ref(false)
    const isLookNotice = ref()

    // 添加
    const event_id = ref('')
    const event_name = ref('')
    const event_level = ref('')
    const event_car_num = ref('')
    const event_driver = ref('')
    const event_area = ref('')

    const isEnter = ref(false)
    const ID = ref()


    // 发布公告
    const textType = ref()
    const textDetail = ref()
    const textDate = ref()
    const textDateNow = ref()
    const noticeLists = ref([])
    const total = ref(0)
    const offset_ = ref(0)
    const currentData = ref([])

    // 可视化
    const SceneEvent = ref([])
    const eventType = ref([])
    const event = ref([])

    const searchByid = (id) => {
        ID.value = id
    }
    return {
        isZoom,
        isDraw,
        isClickTool,
        isAdd,
        isAdded,
        isTrue,
        ID,
        isEnter,
        event_id,
        event_name,
        event_level,
        event_car_num,
        event_driver,
        event_area,
        isSelected,
        textType,
        textDetail,
        noticeLists,
        isNotice,
        isLookNotice,
        textDate,
        textDateNow,
        total,
        offset_,
        currentData,
        SceneEvent,
        eventType,
        event,
        searchByid,
    }
})

export { mapStore }